You are here: Symbol Reference > Dew Namespace > Dew.Signal Namespace > Dew.Signal.Units Namespace > Classes > SignalUtils Class > SignalUtils Methods > SignalUtils.Differentiate Method
Dew Signal for .NET
ContentsIndexHome
PreviousUpNext
SignalUtils.Differentiate Method

Differentiate the signal.

Syntax
C#
Visual Basic
public static TVec Differentiate([In] TVec Src, [In] TVec Dst, ref TDiffState State, double Dt);

Differentiate the signal Src and place the result in Dst, The routine can also be used for streaming data, if the value of the State parameter is preserved between consecutive calls. dT defines the sampling period. Src can be complex or real. For setting the initial conditions to other then 0 see the TDiffState description. 

The following formula is used for numeric differentiation: 

 

y[i] = (x[i] - x[i-2]) / (2 * dT) dT ... sampling period x - input y - output

 

The filter does not preserve linear phase, but it is more accurate than: 

y[i] = (x[i]-x[i-1])/dT 

 

which can be rewriten as: 

y[i] = ((x[i] - x[i-1]) + (x[i-1] - x[i-2]))/2 * 1/dT 

To apply a differentiator preserving linear phase see the OptimalFir.RemezImpulse and KaiserImpulse routines. 

Note Record types as well as all other variables are automatically initialized to zero, if they are declared as fields of an object. The state variable of the Differentiate routine has to be initialized before it can be used, if declared within a routine.

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!